package com.atqinke.designpattern.behavioraltype.state.stateplus;

/**
 * @BelongsProject: BasicConnection
 * @BelongsPackage: com.atqinke.designpattern.behavioraltype.state.stateplus
 * @Author: NieHk
 * @CreateTime: 2022-08-29  09:57
 * @Description: 开启状态
 * @Version: 1.0
 */
public class OpenningState extends LiftState {


    @Override
    public void open() {
        System.out.println("电梯门已开启...");
    }

    @Override
    public void close() {
        //状态修改
        super.context.setLiftState(Context.closeingState);
        //动作委托为CloseState来执行
        super.context.getLiftState().close();
    }


    @Override
    public void run() {
        System.out.println("电梯正在开启状态，无法运行");
    }


    @Override
    public void stop() {
        System.out.println("电梯正在开启状态，无法关闭");
    }
}
